<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-bind实例</title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>v-bind实例</h1>
    <hr>
    <div id="app">
        <p><img v-bind:src="imgSrc"/></p>
        <p><a v-bind:href="webUrl" target="_blank">技术胖</a></p>
        <hr>
        <div :class="classA">1.绑定ClassA</div>
        <div :class="{classA:isOk}">2.绑定Class中的判断</div>
        <div :class="[classA,classB]">3.绑定Class中的数组</div>
        <div :class="isOk?classA:classB">4.绑定Class中的三元运算符</div>
        <hr>
        <div>
            <input type="checkbox" id="isOk" v-model="isOk">
            <label for="isOk">isOk={{isOk}}</label>
        </div>
        <hr>
        <div :style="{color:red,fontSize:font}">5.绑定Style</div>
        <div :style="styleObject">6.绑定Style对象</div>
    </div>
    <style>
        .classA{
            color:red
        }
        .classB{
           font-size:150%
        }
    </style>
    <script type="text/javascript">
        var app=new Vue({
            el:'#app',
            data:{
                message:'hello world1111!',
                imgSrc:'https://pic.xiami.net/images/album/img72/71/58d0991517cd2_3586872_1490065685.jpg?x-oss-process=image/resize,limit_0,m_pad,w_185,h_185',
                webUrl:'http://jspang.com',
                // className:'classA',
                isOk:false,
                classA:'classA',
                classB:'classB',
                red:'red',
                font:'20px',
                styleObject:{
                    color:'green',
                    fontSize:'24px'
                }
            }
        }) 
    </script>
</body>
</html>